//
//  NetApiPort.swift
//  TestDemoSwift
//
//  Created by 王锦发 on 2020/3/28.
//  Copyright © 2020 WJF. All rights reserved.
//

import Foundation
import UIKit

enum NetApiKey: String {
    case data
    case detailMessage
    case error
    case message
    case status
    case success
}

let NetDataKey          = NetApiKey.data.rawValue
let NetDetailMessageKey = NetApiKey.detailMessage.rawValue
let NetErrorKey         = NetApiKey.error.rawValue
let NetMessageKey       = NetApiKey.message.rawValue
let NetStatusKey        = NetApiKey.status.rawValue
let NetSuccessKey       = NetApiKey.success.rawValue
let NetErrorMsg         = "当前网络不可用,请检查你的网络或刷新重试"
let NetBusyMsg          = "加载失败,请稍后重试"

/******** 接口 ********/
struct NetApiPort {
    
    #if DEBUG
    /// api主域名url
      static let ApiMainUrl = "https://testapipc.singlecloud.cc"
    #else
    /// api主域名url
    static let ApiMainUrl = "ovirtapi.singlecloud.cc"
    #endif

    // MARK: - 注册
    struct Register {
        /// 检查手机号能否注册
        static let checkPhone = "/app/checkPhone"
        /// 注册
        static let register = "/app/register"
    }
    
    // MARK: - 登录
    struct Login {
        /// 忘记密码
        static let forgetPwd = "/app/forgetPassword"
        /// 登录
        static let login = "/app/login"
        /// 登出
        static let logout = "/app/logout"
        /// 修改密码
        static let updatePwd = "/app/updatePassword"
    }
    
    // MARK: - 短信
    struct SMS {
        /// 忘记密码验证码
        static let forgetPwdCode = "/app/sendForgetPasswordCode"
        /// 注册验证码
        static let registerCode = "/app/sms/sendRegisterCode"
    }
    
    // MARK: - 用户
    struct User {
        /// 获取用户信息-手机端
        static let userInfo = "/app/userInfo"
        /// 获取订单信息-手机端
        static let userOrderInfo = "/app/userOrderInfo"
    }
    
    // MARK: - 虚拟机
    struct VirtualMachine {
        /// 手机端 - 关机
        static let turnOff = "/app/turnOff"
        /// 手机端 -开机
        static let turnOn = "/app/turnOn"
        /// 手机端 -配对
        static let moonlight = "/moonlight"
        /// 手机端 -重置虚拟机状态
        static let reset = "/app/reset"
        /// 手机端 -故障申报
        static let save = "/report/save"
        /// 查询SSE
        static let check = "/app/compensate"
    }
    
    // MARK: - 消息
    struct MessageInfo {
        /// 消息列表
        static let list = "/app/information/page"
        /// 消息详情
        static let detail = "/app/information/detail"
    }
    
    // MARK: - 订单
    struct Order {
        /// 订单信息
        static let getInfo = "/app/order/getInfo"
        /// 订单分页列表
        static let orderPage = "/app/order/orderPage"
    }
    
    // MARK: - 支付
    struct Pay {
        /// 保存快照
        static let snapShot = "/app/order/snapShot"
        /// 新增订单
        static let createOrder = "/app/order/createOrder"
        /// 微信预支付
        static let wxPay = "/app/wxPay/unifiedOrder"
        /// 支付宝支付
        static let aliPay = "/app/aliPay/advancePay"
        /// 苹果支付
        static let applePay = "/app/applePay/verify"
    }
    
    
    // MARK: - 推广
    struct Qrcode {
        /// 海报图
        static let banner = "/app/qrcode/spread/banner"
        /// 二维码
        static let code = "/app/qrcode/get"
    }
    
    // MARK: - 激活码
    struct ActivationFront {
        /// 用户兑换明细
        static let page = "/app/activationFront/page"
        /// 兑换激活码
        static let exchangeCode = "/app/exchangeCode"
    }
    
    // MARK: - SSE
    struct SSE {
        /// 关闭
        static let close = "/app/sse/close"
    }
}
